PlayBasic TUTORIALS


     New to programming and need some help getting started ? - Well, then our tutorial section will help kick start your programming adventure. If you're looking for more Source Code / Tutorials & Media ? - Then remember to visit the PlayBasic Resource board on our forums.

Found #1 item in If category by Kevin Picone


 PlayBasic Tutorial: Into to IF / Then and IF / ENDIF statements

By: Kevin Picone Added: March 21st, 2017

Category: All,Comparisons,If,Learn To Code,Beginner

PlayBasic Tutorial: Into to IF / Then and IF / ENDIF statements ( 2017/03/21)

    This #tutorial walks the new coder through the IF / THEN and IF / ENDIF statement pairs which are used to selectively execute sections of the code, based upon the result of the comparison operators. IF statements actually allow changes in execution control, so they act upon the comparison, but it's just easier to think of them as part of the comparisons landscape when learning programming.

#coding #learntocode #programming #basic #makegames #howto #programmer #code



PlayBasic Code:
	Setfps 20

	Do
		Cls rgb(20,30,40)

		;
		Mx = MouseX()
		My = MouseY()

		Circle Mx,My,40,true

		print Mx
		print My


		box 500,300,600,400,false

		if (Mx > 500) and  (Mx < 600) and  My >300 and My<400
						print "Mouse is within zone"
		endif

		Sync
	loop


COMMANDS USED: SETFPS | CLS | RGB | MOUSEX | MOUSEY | CIRCLE | PRINT | BOX | AND | SYNC |






Viewing Page [1] of [0]





Looking for More Tutorials?:



 

 
     
 
       

(c) Copyright 2002 / 2024 Kevin Picone , UnderwareDesign.com  - Privacy Policy   Site: V0.99a [Alpha]